package com.bluefish.bltuan.observer;

import java.util.Observable;
import java.util.Observer;

import org.apache.struts2.ServletActionContext;

import com.bluefish.bltuan.cache.ApplicationUtils;
import com.bluefish.bltuan.module.mail.EmailTemplate;

public class ApplicationObserver implements Observer {

    public void update(Observable o, Object arg) {
        if (arg instanceof EmailTemplate) {
            //更新邮件模板
            EmailTemplate template = (EmailTemplate) arg;
            ApplicationUtils.updateTemplate(ServletActionContext.getServletContext(), template);
        }
    }

}
